// 创建一个路由器，并暴露出去

// 第一步：引入createRouter
import {createRouter,createWebHistory,createWebHashHistory} from 'vue-router'
// 引入一个一个可能要呈现组件


// 第二步：创建路由器
const router = createRouter({
  history:createWebHistory(), //路由器的工作模式
  routes:[ //一个一个的路由规则
    {
        path:'/',
        component:()=>import('@/view/layout.vue'),
        children:[
            {
                name:'one',
                path:'viewone',
                component:()=>import('@/view/viewOne.vue')
            },
            {
                name:'two',
                path:'viewtwo',
                component:()=>import('@/view/viewTwo.vue')
            },
            {
                name:'three',
                path:'viewthree',
                component:()=>import('@/view/viewThree.vue')
            },
            {
                name:'four',
                path:'viewfour',
                component:()=>import('@/view/viewFour.vue')
            },
            {
                name:'five',
                path:'viewfive',
                component:()=>import('@/view/viewFive.vue')
            },
            {
                name:'six',
                path:'viewsix/:a/:b',
                component:()=>import('@/view/viewSix.vue')
            },
            {
                name:'seven',
                path:'viewseven/:a/:b',
                props:true,
                component:()=>import('@/view/viewSeven.vue')
            },
            {
                name:'eight',
                path:'vieweight',
                props(route){
                    return route.query 
                },
                component:()=>import('@/view/viewEight.vue')
            },
            {
                name:'nine',
                path:'viewnine',
                component:()=>import('@/view/viewNine.vue')
            },
            {
                name:'ten',
                path:'viewten',
                component:()=>import('@/view/viewComponentCompute.vue'),
                children:[
                    {
                        name:'moduleone',
                        path:'moduleone',
                        component:()=>import('@/moduleCommute/01_props/Father.vue')
                    },
                    {
                        name:'moduletwo',
                        path:'moduletwo',
                        component:()=>import('@/moduleCommute/02_custom_event/Father.vue')
                    },
                    {
                        name:'modulethree',
                        path:'modulethree',
                        component:()=>import('@/moduleCommute/03_mitt/Father.vue')
                    },
                    {
                        name:'modulefour',
                        path:'modulefour',
                        component:()=>import('@/moduleCommute/04_v-model/Father.vue')
                    },
                    {
                        name:'modulefive',
                        path:'modulefive',
                        component:()=>import('@/moduleCommute/05_$attrs/Father.vue')
                    },
                    {
                        name:'modulesix',
                        path:'modulesix',
                        component:()=>import('@/moduleCommute/06_$refs-$parent/Father.vue')
                    },
                    {
                        name:'moduleseven',
                        path:'moduleseven',
                        component:()=>import('@/moduleCommute/07_provide-inject/Father.vue')
                    },
                    {
                        name:'moduleeight',
                        path:'moduleeight',
                        component:()=>import('@/moduleCommute/08_pinia/Father.vue')
                    },
                    {
                        name:'modulenine',
                        path:'modulenine',
                        component:()=>import('@/moduleCommute/09_slot_默认插槽/Father.vue')
                    },
                    {
                        name:'moduleten',
                        path:'moduleten',
                        component:()=>import('@/moduleCommute/09_slot_具名插槽/Father.vue')
                    },
                    {
                        name:'moduleeleven',
                        path:'moduleeleven',
                        component:()=>import('@/moduleCommute/09_slot_作用域插槽/Father.vue')
                    }
                ]
            }
        ]
    }
  ]
})

// 暴露出去router
export default router
